<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no">
    <title>日新网 - 服务商</title>
    <style>
        .project_label_item select {
            height: .44rem;
        }
        .project_label_item dt  {
            height: .54rem!important;
            line-height: .54rem!important;

        }
        .dd2 {
            height: .9rem!important;
            width: 1.7rem!important;
        }
        .dd3{
            width: 1.6rem!important;
        }
        .dd4{
            width: 1.36rem!important;
        }
        .dd2 i {
            font-size: .14rem;
            line-height: .24rem!important;
            display: inline-block;
            overflow: hidden;
            height: .48rem;
        }
        .project_label_item .active {
            color: #333333;
            border:1px solid #c8161d;
            background-color:#f9f9f9;
        }
        .footer a:nth-child(3) span {
            color: #c8161d;
        }
        .category_dd {
            cursor: pointer;
        }
    </style>
</head>
<body>
<tc_include file="scripts"/>
<tc_include file="Public:nav"/>

<div class="pulse_index comWidth">
    <img src="/themes/simplebootx_mobile/Public/assets/images/sm_logo.png" alt="">
</div>

<div class="comWidth project_index">
    <form id="search_form" action="{:U('Service/Index/index')}" method="post">
        <input type="hidden" name="category_id" value="{$formget.category_id|default=0}">

        <div class="project_label_item clearfix">
            <dl>
                <dt>产业</dt>
                <dd class="category_dd {$formget['category_id'] == 0 ? 'active' : ''}" data-id="0">全部</dd>
                <volist name="categorys" id="vo">
                    <dd class="category_dd {$formget['category_id'] == $vo['id'] ? 'active' : ''}" data-id="{$vo.id}">
                        {$vo.name}
                    </dd>
                </volist>
            </dl>
        </div>

        <div class="project_label_item clearfix">
            <dl>
                <dt>位置</dt>
                <div id="areaInfo" style="margin-left: .5rem;">
                    <input name="city_id" hidden>
                </div>
            </dl>
        </div>
    </form>

    <div class="pulse_content">
        <volist name="lists" id="vo">
            <a href="{:U('Service/Index/service_info', ['id' => $vo['id']])}" class="service_item">
                <div class="pulse_item">
                    <dl class="clearfix">
                        <dd class="dd1">
                            <img src="{:sp_get_image_preview_url($vo['logo'])}" alt="">
                        </dd>
                        <dd class="dd2">
                            <span>{$vo.company_name}</span><br>
                            <i>{$vo.company_desc}</i>
                        </dd>
                        <dd class="dd3">{$vo.scale} </dd>
                        <dd class="dd4">{$vo.established_time}</dd>
                        <dd class="dd5"><?php echo $vo['financing_round'] ? $vo['financing_round'] : '' ?></dd>
                    </dl>
                </div>
            </a>
        </volist>

        <!--加载更多-->
        <div style="width:110px;height: 30px;border-radius: 15px;border: 1px solid #C8161D; color: #C8161D;font-size: 15px;text-align: center;
            line-height: 30px;margin-left: 350px; " class="js-infinite-scroll-loading text-center fontmsyhbd">更多
        </div>
        <div id="nextpage"></div>
    </div>
</div>
<!-- JavaScript -->
<tc_include file="Public:footer"/>
<script src="__TMPL__Public/assets/js/jquery.infiniteScroll.js"></script>
<script src="__PUBLIC__/js/layer/layer_1.js"></script>
<script src="__PUBLIC__/js/area.js"></script>
<script>
    var area = {$area};
    area = eval(area);

    var areaPath = {$path ? $path : []};
    areaPath = eval(areaPath);

    $(function () {
        // 地址选择select的初始化
        initArea(2);
        // 搜索
        $(document).delegate('.category_dd', 'click', function () {
            var category_id = $(this).attr('data-id');
            $('input[name="category_id"]').val(category_id);
            $('#search_form').submit();
        });

        $('#nextpage').infiniteScroll({
            loading: '.js-infinite-scroll-loading',
            total_pages: {$total_pages},
            success: function (content) {
                var $items = $(content).find('.service_item');
                if ($items.length > 0) {
                    $('.js-infinite-scroll-loading').before($items);
                }
            }
        });
    });

    // 地址变动回调
    function select_area_callback() {
        $('#search_form').submit();
    }
</script>
</body>
</html>